import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "login",
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login/Login.vue"),
  },
  {
    path: "/register",
    name: "Register",
    component: () => import("../views/register/Register.vue"),
  },
  {
    path: "/nav",
    name: "Nav",
    component: () => import("../components/Nav/Nav.vue"),
    redirect: "/home",
    children: [
      {
        path: "/immunizationPlan",
        name: "ImmunizationPlan",
        component: () => import("../views/ImmunizationPlan/Immunization.vue"),
      },
      {
        path: "/a1",
        name: "a1",
        component: () => import("../views/ImmunityStatistics/a1.vue"),
      },
      {
        path: "/a2",
        name: "a2",
        component: () => import("../views/ImmunityStatistics/a2.vue"),
      },
      {
        path: "/a3",
        name: "a3",
        component: () => import("../views/ImmunityStatistics/a3.vue"),
      },
      {
        path: "/home",
        name: "home",
        component: () => import("../views/Home/Home.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
